****************************************************************************
* File-Nale: 		chicago2006_ch.do
* Date:		 04/30/2018
* Author: 		Fred Batista
* Purpose: 		individual level analyses of knowledge
* Data used: 		chicago2006_ch.dta
* Data Output:	Journal of Politics� paper	*/
****************************************************************************

*Gender- Q2DD
Age- AGE
*Interest in China international relations - Q1
*Knowledge - Q600 Q605
*Income - Q4DD
*Education - Q3DD
*Size of place - Q6DD
*Weight - WEIGHT_F

* Recodes

gen man = 2 - Q2DD

gen woman = 1 - man

gen age = AGE

gen age_sq = age*age

gen interest = Q1

recode interest (1=3) (2=2) (3=1) (4=0) (99=.)

gen income = Q4DD

recode income (99=.)

gen education = Q3DD

recode education (9=0) (99=.)

gen size = Q6DD

recode size (1=0) (3=1) (4=2)

gen weight = WEIGHT_F


* knowledge items

gen euro = Q600

recode euro (1=1) (else=0)

gen annan = Q605

recode annan (1=1) (else=0)

gen euro2 = Q600

recode euro2 (1=2) (2=1) (3 99=0)

gen annan2 = Q605

recode annan2 (1=2) (2 3 4=1) (99=0)

* ANALYSES

***item analyses

* discrimination

alpha euro annan

* difficulty

summarize euro annan [aweight=weight]

*** Models

* Euro

khb probit euro man || size income education age age_sq interest [pweight=weight]

probit euro man size income education age age_sq interest [pweight=weight]

mlogit euro2 woman size income education age age_sq interest [pweight=weight], base(2)


* Koffi Annan

khb probit annan man || size income education age age_sq interest [pweight=weight]

mlogit annan2 woman size income education age age_sq interest [pweight=weight], base(2)

